﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABELGX
{
    public class CmdParam : CarCmd
    {
        public UserSet UserSet { get; set; }
        public CmdParam(CmdSet set, int length) : base(set, length)
        {
        }

        public override byte[] GetCmd()
        {
            for (int i = 4, j = 0; j < UserSet.Params.Count && i < Cmd.Length - 2; j++, i += 2)
            {
                Cmd[i] = (byte)UserSet.Params[j];
                Cmd[i+1] = (byte)(UserSet.Params[j]>>8);
            }
            CalXOR(Cmd);
            return Cmd;
        }
    }
}
